package hmis.pos.sys.repository;

import hmis.pos.Base.BaseRepository.BaseRepository;
import hmis.pos.sys.entity.SysPermissionEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SysPermissionRepository extends BaseRepository<SysPermissionEntity> {

    @Query(nativeQuery = true, value = "SELECT url FROM sys_permission AS p WHERE p.role_id = :roleId")
    List<String> findPermissionsByRoleId(@Param("roleId") String roleId);

}
